Home / Admin / ACF_KEYSMST_MSTCASECPT – TAB: TREATMENT PROGRESS (v3.0 Modular)
Duplicate Snippet

Embed Snippet on Your Site

ACF_KEYSMST_MSTCASECPT – TAB: TREATMENT PROGRESS (v3.0 Modular)

ismail daugherty PRO
<10
Code Preview
php
<?php
/**
 * ============================================
 * MST CASE - TAB: TREATMENT PROGRESS (v3.0 Modular)
 * ============================================
 * 
 * Purpose: Adds Treatment Progress tab to master field group
 * Parent: group_mst_case_master
 * Source: Form 302 (Weekly Summary) + ongoing progress tracking
 * Fields: 30 fields
 * 
 * VERSION: 3.0 - Modular Architecture
 * Priority: 13 (loads after Safety & Risk)
 * 
 * Purpose: Track ongoing treatment progress, goals, and barriers
 * - Current treatment goals (intermediary goals)
 * - Goal progress tracking (5 goals)
 * - Interventions summary
 * - Family engagement levels
 * - Barriers and strengths
 * - Contact hours tracking
 * - Session attendance
 * 
 * IMPORTANT: Master field group snippet must be active first!
 * ============================================
 */
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}
add_action('acf/init', 'mst_add_treatment_progress_tab', 13);
function mst_add_treatment_progress_tab() {
    
    if (!function_exists('acf_add_local_field')) {
        return;
    }
    
    // ========================================
    // TAB: TREATMENT PROGRESS
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_tab_treatment_progress',
        'label' => '📈 Treatment Progress',
        'name' => '',
        'type' => 'tab',
        'parent' => 'group_mst_case_master',
        'placement' => 'top',
    ));
    
    // ========================================
    // SECTION 1: CURRENT TREATMENT GOALS
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_current_goals',
        'label' => 'Current Treatment Goals',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Active intermediary treatment goals (updated from Form 302 weekly summaries)</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 1: Current Treatment Goals Summary
    acf_add_local_field(array(
        'key' => 'field_current_treatment_goals',
        'label' => 'Current Treatment Goals Summary',
        'name' => 'current_treatment_goals',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Summary of all active intermediary goals',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'rows' => 4,
        'placeholder' => 'List all active treatment goals with target dates',
    ));
    
    // ========================================
    // SECTION 2: GOAL PROGRESS TRACKING (5 Goals)
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_goal_progress',
        'label' => 'Goal Progress Tracking',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Track up to 5 intermediary goals with progress percentages</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Goal 1
    acf_add_local_field(array(
        'key' => 'field_goal_1_description',
        'label' => 'Goal 1 Description',
        'name' => 'goal_1_description',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Specific, measurable goal statement',
        'required' => 0,
        'wrapper' => array('width' => '60'),
        'rows' => 2,
        'placeholder' => 'WHO will do WHAT by WHEN',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_1_progress',
        'label' => 'Goal 1 Progress',
        'name' => 'goal_1_progress',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Current progress status',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'choices' => array(
            'not_started' => 'Not Started',
            'in_progress' => 'In Progress',
            'achieved' => 'Achieved',
            'abandoned' => 'Abandoned',
        ),
        'default_value' => 'not_started',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_1_percentage',
        'label' => 'Goal 1 %',
        'name' => 'goal_1_percentage',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Completion percentage',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'default_value' => 0,
        'append' => '%',
        'min' => 0,
        'max' => 100,
        'step' => 5,
    ));
    
    // Goal 2
    acf_add_local_field(array(
        'key' => 'field_goal_2_description',
        'label' => 'Goal 2 Description',
        'name' => 'goal_2_description',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Specific, measurable goal statement',
        'required' => 0,
        'wrapper' => array('width' => '60'),
        'rows' => 2,
        'placeholder' => 'WHO will do WHAT by WHEN',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_2_progress',
        'label' => 'Goal 2 Progress',
        'name' => 'goal_2_progress',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'choices' => array(
            'not_started' => 'Not Started',
            'in_progress' => 'In Progress',
            'achieved' => 'Achieved',
            'abandoned' => 'Abandoned',
        ),
        'default_value' => 'not_started',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_2_percentage',
        'label' => 'Goal 2 %',
        'name' => 'goal_2_percentage',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'default_value' => 0,
        'append' => '%',
        'min' => 0,
        'max' => 100,
        'step' => 5,
    ));
    
    // Goal 3
    acf_add_local_field(array(
        'key' => 'field_goal_3_description',
        'label' => 'Goal 3 Description',
        'name' => 'goal_3_description',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '60'),
        'rows' => 2,
        'placeholder' => 'WHO will do WHAT by WHEN',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_3_progress',
        'label' => 'Goal 3 Progress',
        'name' => 'goal_3_progress',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'choices' => array(
            'not_started' => 'Not Started',
            'in_progress' => 'In Progress',
            'achieved' => 'Achieved',
            'abandoned' => 'Abandoned',
        ),
        'default_value' => 'not_started',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_3_percentage',
        'label' => 'Goal 3 %',
        'name' => 'goal_3_percentage',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'default_value' => 0,
        'append' => '%',
        'min' => 0,
        'max' => 100,
        'step' => 5,
    ));
    
    // Goal 4
    acf_add_local_field(array(
        'key' => 'field_goal_4_description',
        'label' => 'Goal 4 Description',
        'name' => 'goal_4_description',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '60'),
        'rows' => 2,
        'placeholder' => 'WHO will do WHAT by WHEN',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_4_progress',
        'label' => 'Goal 4 Progress',
        'name' => 'goal_4_progress',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'choices' => array(
            'not_started' => 'Not Started',
            'in_progress' => 'In Progress',
            'achieved' => 'Achieved',
            'abandoned' => 'Abandoned',
        ),
        'default_value' => 'not_started',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_4_percentage',
        'label' => 'Goal 4 %',
        'name' => 'goal_4_percentage',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'default_value' => 0,
        'append' => '%',
        'min' => 0,
        'max' => 100,
        'step' => 5,
    ));
    
    // Goal 5
    acf_add_local_field(array(
        'key' => 'field_goal_5_description',
        'label' => 'Goal 5 Description',
        'name' => 'goal_5_description',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '60'),
        'rows' => 2,
        'placeholder' => 'WHO will do WHAT by WHEN',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_5_progress',
        'label' => 'Goal 5 Progress',
        'name' => 'goal_5_progress',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'choices' => array(
            'not_started' => 'Not Started',
            'in_progress' => 'In Progress',
            'achieved' => 'Achieved',
            'abandoned' => 'Abandoned',
        ),
        'default_value' => 'not_started',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    acf_add_local_field(array(
        'key' => 'field_goal_5_percentage',
        'label' => 'Goal 5 %',
        'name' => 'goal_5_percentage',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'required' => 0,
        'wrapper' => array('width' => '20'),
        'default_value' => 0,
        'append' => '%',
        'min' => 0,
        'max' => 100,
        'step' => 5,
    ));
    
    // ========================================
    // SECTION 3: INTERVENTIONS & ENGAGEMENT
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_interventions',
        'label' => 'Interventions & Engagement',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Current interventions and family engagement levels</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 17: Interventions Summary
    acf_add_local_field(array(
        'key' => 'field_interventions_summary',
        'label' => 'Current Interventions Summary',
        'name' => 'interventions_summary',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Summary of active MST interventions',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'rows' => 3,
        'placeholder' => 'List active interventions by system (Individual, Family, Peer, School, Community)',
    ));
    
    // Field 18: Family Engagement Level
    acf_add_local_field(array(
        'key' => 'field_family_engagement_level',
        'label' => 'Family Engagement Level',
        'name' => 'family_engagement_level',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Overall family participation and engagement',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            'low' => 'Low - Minimal participation',
            'moderate' => 'Moderate - Inconsistent engagement',
            'high' => 'High - Actively engaged',
        ),
        'default_value' => 'moderate',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    // Field 19: Barriers Current
    acf_add_local_field(array(
        'key' => 'field_barriers_current',
        'label' => 'Current Barriers to Treatment',
        'name' => 'barriers_current',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Active barriers impacting treatment progress',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 3,
        'placeholder' => 'Identify current obstacles and challenges',
    ));
    
    // Field 20: Strengths Leveraged
    acf_add_local_field(array(
        'key' => 'field_strengths_leveraged',
        'label' => 'Strengths Being Leveraged',
        'name' => 'strengths_leveraged',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Family/youth strengths currently being utilized',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 3,
        'placeholder' => 'List strengths actively being used in treatment',
    ));
    
    // ========================================
    // SECTION 4: CONTACT HOURS & ATTENDANCE
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_contact_hours',
        'label' => 'Contact Hours & Attendance',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Contact hour tracking and session attendance (auto-updated from Form 301)</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 21: Contact Hours This Week
    acf_add_local_field(array(
        'key' => 'field_contact_hours_this_week',
        'label' => 'Contact Hours This Week',
        'name' => 'contact_hours_this_week',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Total contact hours for current week (auto-calculated from Form 301)',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => 0,
        'append' => 'hours',
        'min' => 0,
        'max' => 40,
        'step' => 0.25,
        'readonly' => 1,
    ));
    
    // Field 22: Contact Hours Total
    acf_add_local_field(array(
        'key' => 'field_contact_hours_total',
        'label' => 'Total Contact Hours',
        'name' => 'contact_hours_total',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Cumulative contact hours since treatment start',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => 0,
        'append' => 'hours',
        'min' => 0,
        'step' => 0.25,
        'readonly' => 1,
    ));
    
    // Field 23: Sessions Completed
    acf_add_local_field(array(
        'key' => 'field_sessions_completed',
        'label' => 'Sessions Completed',
        'name' => 'sessions_completed',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Total number of completed sessions',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => 0,
        'min' => 0,
        'step' => 1,
        'readonly' => 1,
    ));
    
    // Field 24: Sessions Cancelled
    acf_add_local_field(array(
        'key' => 'field_sessions_cancelled',
        'label' => 'Sessions Cancelled',
        'name' => 'sessions_cancelled',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Total number of cancelled/missed sessions',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => 0,
        'min' => 0,
        'step' => 1,
        'readonly' => 1,
    ));
    
    // Field 25: Homework Compliance
    acf_add_local_field(array(
        'key' => 'field_homework_compliance',
        'label' => 'Homework Compliance',
        'name' => 'homework_compliance',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Family completion of between-session tasks',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'choices' => array(
            'poor' => 'Poor - Rarely completes homework',
            'fair' => 'Fair - Sometimes completes homework',
            'good' => 'Good - Usually completes homework',
            'excellent' => 'Excellent - Consistently completes homework',
        ),
        'default_value' => 'fair',
        'ui' => 1,
        'return_format' => 'value',
    ));
}

Comments

Add a Comment