| |
| <?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| if (!defined('ABSPATH')) {
|
| exit;
|
| }
|
|
|
| add_action('acf/init', 'mst_add_safety_risk_tab', 12);
|
|
|
| function mst_add_safety_risk_tab() {
|
|
|
| if (!function_exists('acf_add_local_field')) {
|
| return;
|
| }
|
|
|
|
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_tab_safety_risk',
|
| 'label' => '⚠️ Safety & Risk',
|
| 'name' => '',
|
| 'type' => 'tab',
|
| 'parent' => 'group_mst_case_master',
|
| 'placement' => 'top',
|
| ));
|
|
|
|
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_section_current_safety',
|
| 'label' => 'Current Safety Status',
|
| 'name' => '',
|
| 'type' => 'message',
|
| 'parent' => 'group_mst_case_master',
|
| 'message' => '<strong style="color: #d63638;">⚠️ CRITICAL: Current safety assessment and risk levels (updated from Form 245 and Form 301)</strong>',
|
| 'new_lines' => '',
|
| 'esc_html' => 0,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_current_safety_status',
|
| 'label' => 'Current Safety Status',
|
| 'name' => 'current_safety_status',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Overall safety status - triggers escalation protocols',
|
| 'required' => 1,
|
| 'wrapper' => array('width' => '50'),
|
| 'choices' => array(
|
| 'safe' => '✅ Safe - No Current Concerns',
|
| 'monitor' => '👁️ Monitor - Low Risk Factors Present',
|
| 'high_risk' => '⚠️ High Risk - Active Safety Plan Required',
|
| 'critical' => '🚨 Critical - Immediate Intervention Required',
|
| ),
|
| 'default_value' => 'safe',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_last_safety_assessment_date',
|
| 'label' => 'Last Safety Assessment',
|
| 'name' => 'last_safety_assessment_date',
|
| 'type' => 'date_picker',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Date of most recent Form 245 completion',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'display_format' => 'm/d/Y',
|
| 'return_format' => 'Y-m-d',
|
| 'first_day' => 0,
|
| ));
|
|
|
|
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_section_risk_levels',
|
| 'label' => 'Specific Risk Assessment',
|
| 'name' => '',
|
| 'type' => 'message',
|
| 'parent' => 'group_mst_case_master',
|
| 'message' => '<strong>Individual risk factors tracked separately</strong>',
|
| 'new_lines' => '',
|
| 'esc_html' => 0,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_suicide_risk_current',
|
| 'label' => 'Suicide Risk Level',
|
| 'name' => 'suicide_risk_current',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Current suicide risk assessment',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'choices' => array(
|
| 'none' => 'None - No Risk',
|
| 'low' => 'Low - Past History Only',
|
| 'moderate' => 'Moderate - Current Ideation',
|
| 'high' => 'High - Plan Present',
|
| 'imminent' => 'Imminent - Immediate Risk',
|
| ),
|
| 'default_value' => 'none',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_self_harm_risk',
|
| 'label' => 'Self-Harm Risk',
|
| 'name' => 'self_harm_risk',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Non-suicidal self-injury risk',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'choices' => array(
|
| 'none' => 'None',
|
| 'low' => 'Low',
|
| 'moderate' => 'Moderate',
|
| 'high' => 'High',
|
| ),
|
| 'default_value' => 'none',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_violence_risk_to_others',
|
| 'label' => 'Violence Risk (to others)',
|
| 'name' => 'violence_risk_to_others',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Risk of harm to others',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'choices' => array(
|
| 'none' => 'None - No Risk',
|
| 'low' => 'Low - Verbal Threats Only',
|
| 'moderate' => 'Moderate - History of Violence',
|
| 'high' => 'High - Plan Present',
|
| 'imminent' => 'Imminent - Immediate Risk',
|
| ),
|
| 'default_value' => 'none',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_substance_abuse_current',
|
| 'label' => 'Substance Use Risk',
|
| 'name' => 'substance_abuse_current',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Current substance use severity',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'choices' => array(
|
| 'none' => 'None',
|
| 'minimal' => 'Minimal - Experimental',
|
| 'moderate' => 'Moderate - Regular Use',
|
| 'severe' => 'Severe - Daily Use',
|
| 'overdose_risk' => 'Critical - Overdose Risk',
|
| ),
|
| 'default_value' => 'none',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_runaway_risk',
|
| 'label' => 'Runaway Risk',
|
| 'name' => 'runaway_risk',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Risk of youth running away',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'choices' => array(
|
| 'none' => 'None - No History',
|
| 'low' => 'Low - Past History',
|
| 'moderate' => 'Moderate - Recent Threats',
|
| 'high' => 'High - Imminent Risk',
|
| ),
|
| 'default_value' => 'none',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_sexual_behavior_concerns',
|
| 'label' => 'Sexual Behavior Concerns',
|
| 'name' => 'sexual_behavior_concerns',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Risky or problematic sexual behavior',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'choices' => array(
|
| 'none' => 'None',
|
| 'monitor' => 'Monitor - Age-inappropriate activity',
|
| 'significant' => 'Significant - Safety concerns',
|
| ),
|
| 'default_value' => 'none',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_section_safety_plan',
|
| 'label' => 'Safety Plan & Protocols',
|
| 'name' => '',
|
| 'type' => 'message',
|
| 'parent' => 'group_mst_case_master',
|
| 'message' => '<strong>Active safety plan and crisis response protocols</strong>',
|
| 'new_lines' => '',
|
| 'esc_html' => 0,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_safety_plan_active',
|
| 'label' => 'Safety Plan Status',
|
| 'name' => 'safety_plan_active',
|
| 'type' => 'true_false',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Is there an active safety plan in place?',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'message' => 'Active safety plan in place',
|
| 'default_value' => 0,
|
| 'ui' => 1,
|
| 'ui_on_text' => 'Yes',
|
| 'ui_off_text' => 'No',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_safety_plan_reviewed_date',
|
| 'label' => 'Safety Plan Last Reviewed',
|
| 'name' => 'safety_plan_reviewed_date',
|
| 'type' => 'date_picker',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Date safety plan was last reviewed with family',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'display_format' => 'm/d/Y',
|
| 'return_format' => 'Y-m-d',
|
| 'first_day' => 0,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_safety_plan_baseline',
|
| 'label' => 'Current Safety Plan',
|
| 'name' => 'safety_plan_baseline',
|
| 'type' => 'textarea',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Summary of current safety plan and protocols',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '100'),
|
| 'rows' => 4,
|
| 'maxlength' => '',
|
| 'placeholder' => 'Summarize key safety plan elements, warning signs, coping strategies, and crisis contacts',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_safety_concerns_current',
|
| 'label' => 'Current Safety Concerns',
|
| 'name' => 'safety_concerns_current',
|
| 'type' => 'textarea',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Detailed description of current safety concerns',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '100'),
|
| 'rows' => 3,
|
| 'placeholder' => 'Detail specific safety concerns, triggers, and risk factors',
|
| ));
|
|
|
|
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_section_crisis_info',
|
| 'label' => 'Crisis Response Information',
|
| 'name' => '',
|
| 'type' => 'message',
|
| 'parent' => 'group_mst_case_master',
|
| 'message' => '<strong>Emergency contacts and crisis response protocols</strong>',
|
| 'new_lines' => '',
|
| 'esc_html' => 0,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_crisis_contacts',
|
| 'label' => 'Crisis Contacts',
|
| 'name' => 'crisis_contacts',
|
| 'type' => 'textarea',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Emergency contacts for crisis situations',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '100'),
|
| 'rows' => 3,
|
| 'placeholder' => 'List emergency contacts with names, relationships, phone numbers, and availability',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_psychiatric_provider',
|
| 'label' => 'Psychiatric Provider',
|
| 'name' => 'psychiatric_provider',
|
| 'type' => 'text',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Current psychiatrist or prescriber name',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'placeholder' => 'Provider name',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_psychiatric_provider_phone',
|
| 'label' => 'Psychiatric Provider Phone',
|
| 'name' => 'psychiatric_provider_phone',
|
| 'type' => 'text',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Provider contact phone',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'placeholder' => 'Phone number',
|
| ));
|
|
|
|
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_section_medications',
|
| 'label' => 'Medications & Compliance',
|
| 'name' => '',
|
| 'type' => 'message',
|
| 'parent' => 'group_mst_case_master',
|
| 'message' => '<strong>Current medications and compliance tracking</strong>',
|
| 'new_lines' => '',
|
| 'esc_html' => 0,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_current_medications',
|
| 'label' => 'Current Medications',
|
| 'name' => 'current_medications',
|
| 'type' => 'textarea',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'List all current medications, dosages, and purposes',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '100'),
|
| 'rows' => 3,
|
| 'placeholder' => 'Medication name | Dosage | Frequency | Purpose',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_medication_compliance',
|
| 'label' => 'Medication Compliance',
|
| 'name' => 'medication_compliance',
|
| 'type' => 'select',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Level of medication adherence',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '100'),
|
| 'choices' => array(
|
| 'na' => 'N/A - No Medications',
|
| 'poor' => 'Poor - Rarely takes as prescribed',
|
| 'fair' => 'Fair - Sometimes misses doses',
|
| 'good' => 'Good - Usually compliant',
|
| 'excellent' => 'Excellent - Consistently compliant',
|
| ),
|
| 'default_value' => 'na',
|
| 'allow_null' => 0,
|
| 'ui' => 1,
|
| 'return_format' => 'value',
|
| ));
|
|
|
|
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_section_safety_history',
|
| 'label' => 'Safety Incident History',
|
| 'name' => '',
|
| 'type' => 'message',
|
| 'parent' => 'group_mst_case_master',
|
| 'message' => '<strong>Historical safety incidents and escalations</strong>',
|
| 'new_lines' => '',
|
| 'esc_html' => 0,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_psychiatric_hospitalization_history',
|
| 'label' => 'Psychiatric Hospitalization History',
|
| 'name' => 'psychiatric_hospitalization_history',
|
| 'type' => 'textarea',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'History of psychiatric hospitalizations',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '100'),
|
| 'rows' => 2,
|
| 'placeholder' => 'Date | Facility | Reason | Duration',
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_safety_escalations_count',
|
| 'label' => 'Total Safety Escalations',
|
| 'name' => 'safety_escalations_count',
|
| 'type' => 'number',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Number of safety escalations since case opened',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'default_value' => 0,
|
| 'min' => 0,
|
| 'step' => 1,
|
| 'readonly' => 1,
|
| ));
|
|
|
|
|
| acf_add_local_field(array(
|
| 'key' => 'field_last_safety_incident_date',
|
| 'label' => 'Last Safety Incident',
|
| 'name' => 'last_safety_incident_date',
|
| 'type' => 'date_picker',
|
| 'parent' => 'group_mst_case_master',
|
| 'instructions' => 'Date of most recent safety incident',
|
| 'required' => 0,
|
| 'wrapper' => array('width' => '50'),
|
| 'display_format' => 'm/d/Y',
|
| 'return_format' => 'Y-m-d',
|
| 'first_day' => 0,
|
| ));
|
| }
|
| |
| |
Comments