Home / Admin / ACF_KEYSMST_MSTCASECPT – BASELINE MEASUREMENTS (v3.0 Modular)
Duplicate Snippet

Embed Snippet on Your Site

ACF_KEYSMST_MSTCASECPT – BASELINE MEASUREMENTS (v3.0 Modular)

ismail daugherty PRO
<10
Code Preview
php
<?php
/**
 * ============================================
 * MST CASE - TAB: BASELINE MEASUREMENTS (v3.0 Modular)
 * ============================================
 * 
 * Purpose: Adds Baseline Measurements tab to master field group
 * Parent: group_mst_case_master
 * Source: Forms 244, 245, 240, 218 - Pre-treatment baseline data
 * Fields: 35 fields
 * 
 * VERSION: 3.0 - Modular Architecture
 * Priority: 16 (loads after MST Fidelity Tracking)
 * 
 * Purpose: Capture all pre-treatment baselines for outcome measurement
 * CRITICAL: Can't measure progress without baseline data
 * 
 * Baseline Categories:
 * - Responsible Behaviors (youth/caregiver perspectives)
 * - Instrumental Baselines (measurable behaviors)
 * - Affective Baselines (relationship quality)
 * - Clinical Planning Baselines
 * - Engagement Baselines
 * - Protective/Risk Factors
 * 
 * IMPORTANT: Master field group snippet must be active first!
 * ============================================
 */
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}
add_action('acf/init', 'mst_add_baseline_measurements_tab', 16);
function mst_add_baseline_measurements_tab() {
    
    if (!function_exists('acf_add_local_field')) {
        return;
    }
    
    // ========================================
    // TAB: BASELINE MEASUREMENTS
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_tab_baseline_measurements',
        'label' => '📊 Baseline Measurements',
        'name' => '',
        'type' => 'tab',
        'parent' => 'group_mst_case_master',
        'placement' => 'top',
    ));
    
    // ========================================
    // SECTION 1: RESPONSIBLE BEHAVIORS BASELINE
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_responsible_behaviors',
        'label' => 'Responsible Behaviors Baseline',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong style="color: #d63638;">🎯 CRITICAL: Pre-treatment baseline views of referral behaviors</strong><br>Capture youth, caregiver, school, and community perspectives BEFORE treatment begins',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 1: Youth's Initial View
    acf_add_local_field(array(
        'key' => 'field_responsible_behaviors_youth_initial',
        'label' => 'Youth\'s View of Problems (Baseline)',
        'name' => 'responsible_behaviors_youth_initial',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'How youth describes referral problems at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 3,
        'placeholder' => 'Youth\'s perspective on what brought them to MST',
    ));
    
    // Field 2: Youth Behavior Frequency
    acf_add_local_field(array(
        'key' => 'field_responsible_behaviors_youth_frequency',
        'label' => 'Frequency (Youth Report)',
        'name' => 'responsible_behaviors_youth_frequency',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'How often behaviors occur per youth',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            'daily' => 'Daily',
            'weekly' => 'Several times per week',
            'monthly' => 'Monthly',
            'rarely' => 'Rarely',
        ),
        'default_value' => '',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    // Field 3: Caregiver's Initial View
    acf_add_local_field(array(
        'key' => 'field_responsible_behaviors_caregiver_initial',
        'label' => 'Caregiver\'s View of Problems (Baseline)',
        'name' => 'responsible_behaviors_caregiver_initial',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'How caregiver describes referral problems at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 3,
        'placeholder' => 'Caregiver\'s perspective on referral behaviors',
    ));
    
    // Field 4: Caregiver Behavior Frequency
    acf_add_local_field(array(
        'key' => 'field_responsible_behaviors_caregiver_frequency',
        'label' => 'Frequency (Caregiver Report)',
        'name' => 'responsible_behaviors_caregiver_frequency',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'How often behaviors occur per caregiver',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            'daily' => 'Daily',
            'weekly' => 'Several times per week',
            'monthly' => 'Monthly',
            'rarely' => 'Rarely',
        ),
        'default_value' => '',
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    // Field 5: School Perspective
    acf_add_local_field(array(
        'key' => 'field_responsible_behaviors_school_initial',
        'label' => 'School\'s Perspective (Baseline)',
        'name' => 'responsible_behaviors_school_initial',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'School concerns at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 2,
        'placeholder' => 'School-reported concerns and behaviors',
    ));
    
    // Field 6: Community Perspective
    acf_add_local_field(array(
        'key' => 'field_responsible_behaviors_community_initial',
        'label' => 'Community Concerns (Baseline)',
        'name' => 'responsible_behaviors_community_initial',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Community concerns at baseline (DJS, police, neighbors)',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 2,
        'placeholder' => 'Community-reported concerns',
    ));
    
    // ========================================
    // SECTION 2: INSTRUMENTAL BASELINES
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_instrumental',
        'label' => 'Instrumental Baselines (Measurable Behaviors)',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Objective, measurable baseline data</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 7: School Attendance
    acf_add_local_field(array(
        'key' => 'field_baseline_school_attendance',
        'label' => 'School Attendance (Last 30 Days)',
        'name' => 'baseline_school_attendance',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Percentage of days attended',
        'required' => 0,
        'wrapper' => array('width' => '33'),
        'default_value' => '',
        'append' => '%',
        'min' => 0,
        'max' => 100,
        'step' => 1,
    ));
    
    // Field 8: School Suspensions
    acf_add_local_field(array(
        'key' => 'field_baseline_school_suspensions',
        'label' => 'School Suspensions (Last 90 Days)',
        'name' => 'baseline_school_suspensions',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Number of suspensions',
        'required' => 0,
        'wrapper' => array('width' => '33'),
        'default_value' => 0,
        'min' => 0,
        'step' => 1,
    ));
    
    // Field 9: Arrests (Last 90 Days)
    acf_add_local_field(array(
        'key' => 'field_baseline_arrests_90days',
        'label' => 'Arrests (Last 90 Days)',
        'name' => 'baseline_arrests_90days',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Number of arrests',
        'required' => 0,
        'wrapper' => array('width' => '34'),
        'default_value' => 0,
        'min' => 0,
        'step' => 1,
    ));
    
    // Field 10: Curfew Compliance
    acf_add_local_field(array(
        'key' => 'field_baseline_curfew_compliance',
        'label' => 'Curfew Compliance',
        'name' => 'baseline_curfew_compliance',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'How often youth makes curfew',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            'never' => 'Never/Rarely (0-25%)',
            'sometimes' => 'Sometimes (26-50%)',
            'usually' => 'Usually (51-75%)',
            'always' => 'Always/Almost Always (76-100%)',
        ),
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    // Field 11: Chore Completion
    acf_add_local_field(array(
        'key' => 'field_baseline_chore_completion',
        'label' => 'Chore/Responsibility Completion',
        'name' => 'baseline_chore_completion',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'How often youth completes assigned tasks',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            '0-25' => '0-25% of the time',
            '26-50' => '26-50% of the time',
            '51-75' => '51-75% of the time',
            '76-100' => '76-100% of the time',
        ),
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    // Field 12: Substance Use Days
    acf_add_local_field(array(
        'key' => 'field_baseline_substance_use_days',
        'label' => 'Substance Use (Days Last 30)',
        'name' => 'baseline_substance_use_days',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Number of days used in last 30 days',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'default_value' => 0,
        'append' => 'days',
        'min' => 0,
        'max' => 30,
        'step' => 1,
    ));
    
    // Field 13: Positive Peer Contact
    acf_add_local_field(array(
        'key' => 'field_baseline_peer_contact_positive',
        'label' => 'Positive Peer Contact (Hours/Week)',
        'name' => 'baseline_peer_contact_positive',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Hours per week with prosocial peers',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'default_value' => 0,
        'append' => 'hrs/wk',
        'min' => 0,
        'step' => 1,
    ));
    
    // Field 14: Negative Peer Contact
    acf_add_local_field(array(
        'key' => 'field_baseline_peer_contact_negative',
        'label' => 'Negative Peer Contact (Hours/Week)',
        'name' => 'baseline_peer_contact_negative',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Hours per week with antisocial peers',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'default_value' => 0,
        'append' => 'hrs/wk',
        'min' => 0,
        'step' => 1,
    ));
    
    // ========================================
    // SECTION 3: AFFECTIVE BASELINES
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_affective',
        'label' => 'Affective Baselines (Relationship Quality)',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Baseline relationship quality measures (1-10 scales)</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 15: Family Communication
    acf_add_local_field(array(
        'key' => 'field_baseline_family_communication',
        'label' => 'Family Communication Quality',
        'name' => 'baseline_family_communication',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=Very Poor, 10=Excellent)',
        'required' => 0,
        'wrapper' => array('width' => '33'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 16: Family Cohesion
    acf_add_local_field(array(
        'key' => 'field_baseline_family_cohesion',
        'label' => 'Family Cohesion/Closeness',
        'name' => 'baseline_family_cohesion',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=Very Distant, 10=Very Close)',
        'required' => 0,
        'wrapper' => array('width' => '33'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 17: Family Conflict
    acf_add_local_field(array(
        'key' => 'field_baseline_family_conflict',
        'label' => 'Family Conflict Level',
        'name' => 'baseline_family_conflict',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=No Conflict, 10=Severe Conflict)',
        'required' => 0,
        'wrapper' => array('width' => '34'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 18: Youth Mood
    acf_add_local_field(array(
        'key' => 'field_baseline_youth_mood',
        'label' => 'Youth Mood/Affect',
        'name' => 'baseline_youth_mood',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'General mood presentation at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            'depressed' => 'Depressed/Down',
            'anxious' => 'Anxious/Worried',
            'stable' => 'Stable/Neutral',
            'happy' => 'Happy/Positive',
            'irritable' => 'Irritable/Angry',
        ),
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    // Field 19: Caregiver Stress
    acf_add_local_field(array(
        'key' => 'field_baseline_caregiver_stress',
        'label' => 'Caregiver Stress Level',
        'name' => 'baseline_caregiver_stress',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=No Stress, 10=Extreme Stress)',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 20: Sibling Relationships
    acf_add_local_field(array(
        'key' => 'field_baseline_sibling_relationships',
        'label' => 'Sibling Relationships',
        'name' => 'baseline_sibling_relationships',
        'type' => 'select',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Quality of relationships with siblings',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'choices' => array(
            'na' => 'N/A - No Siblings',
            'poor' => 'Poor - Constant conflict',
            'fair' => 'Fair - Some conflict',
            'good' => 'Good - Generally positive',
            'excellent' => 'Excellent - Very close',
        ),
        'ui' => 1,
        'return_format' => 'value',
    ));
    
    // ========================================
    // SECTION 4: CLINICAL PLANNING BASELINES
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_clinical_planning',
        'label' => 'Clinical Planning Baselines',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Initial treatment planning from assessment phase</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 21: Initial Do List
    acf_add_local_field(array(
        'key' => 'field_initial_do_list',
        'label' => 'Initial "Do" List (Week 1)',
        'name' => 'initial_do_list',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'First week "Do" list in MST format: WHO will do WHAT by WHEN',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'rows' => 4,
        'placeholder' => 'Format: WHO will do WHAT by WHEN\nExample: Mom will implement point chart by Tuesday 3pm',
    ));
    
    // Field 22: Initial Intervention Categories
    acf_add_local_field(array(
        'key' => 'field_initial_intervention_categories',
        'label' => 'Initial Intervention Categories',
        'name' => 'initial_intervention_categories',
        'type' => 'checkbox',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Systems targeted in initial intervention plan',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'choices' => array(
            'individual' => 'Individual (Youth)',
            'family' => 'Family System',
            'school' => 'School System',
            'peer' => 'Peer System',
            'community' => 'Community Resources',
        ),
        'default_value' => array(),
        'layout' => 'horizontal',
        'return_format' => 'value',
    ));
    
    // Field 23: Barriers to Treatment
    acf_add_local_field(array(
        'key' => 'field_barriers_to_treatment',
        'label' => 'Identified Barriers to Treatment',
        'name' => 'barriers_to_treatment',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Obstacles identified at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 3,
        'placeholder' => 'Transportation, work schedules, past treatment failures, etc.',
    ));
    
    // Field 24: Strengths to Leverage
    acf_add_local_field(array(
        'key' => 'field_strengths_to_leverage',
        'label' => 'Family Strengths to Build On',
        'name' => 'strengths_to_leverage',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Strengths identified at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'rows' => 3,
        'placeholder' => 'Family strengths, resources, and protective factors',
    ));
    
    // ========================================
    // SECTION 5: ENGAGEMENT BASELINES
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_engagement',
        'label' => 'Engagement Baselines',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Initial engagement levels (1-10 scales)</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 25: Youth Engagement
    acf_add_local_field(array(
        'key' => 'field_engagement_baseline_youth',
        'label' => 'Youth Engagement Level',
        'name' => 'engagement_baseline_youth',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=Very Resistant, 10=Highly Motivated)',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 26: Mother Engagement
    acf_add_local_field(array(
        'key' => 'field_engagement_baseline_mother',
        'label' => 'Mother/Female Caregiver Engagement',
        'name' => 'engagement_baseline_mother',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=Very Resistant, 10=Highly Motivated)',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 27: Father Engagement
    acf_add_local_field(array(
        'key' => 'field_engagement_baseline_father',
        'label' => 'Father/Male Caregiver Engagement',
        'name' => 'engagement_baseline_father',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=Very Resistant, 10=Highly Motivated)',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 28: Other Caregiver Engagement
    acf_add_local_field(array(
        'key' => 'field_engagement_baseline_other_caregiver',
        'label' => 'Other Caregiver Engagement',
        'name' => 'engagement_baseline_other_caregiver',
        'type' => 'number',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Rate 1-10 (1=Very Resistant, 10=Highly Motivated)',
        'required' => 0,
        'wrapper' => array('width' => '25'),
        'default_value' => '',
        'min' => 1,
        'max' => 10,
        'step' => 1,
    ));
    
    // Field 29: Engagement Challenges
    acf_add_local_field(array(
        'key' => 'field_engagement_challenges',
        'label' => 'Engagement Challenges',
        'name' => 'engagement_challenges',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Barriers to family engagement identified at baseline',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'rows' => 2,
        'placeholder' => 'Describe challenges to engaging family members in treatment',
    ));
    
    // ========================================
    // SECTION 6: PROTECTIVE/RISK FACTORS
    // ========================================
    acf_add_local_field(array(
        'key' => 'field_section_protective_risk',
        'label' => 'Protective & Risk Factors',
        'name' => '',
        'type' => 'message',
        'parent' => 'group_mst_case_master',
        'message' => '<strong>Baseline protective factors and risk factors</strong>',
        'new_lines' => '',
        'esc_html' => 0,
    ));
    
    // Field 30: Protective Factors Baseline
    acf_add_local_field(array(
        'key' => 'field_protective_factors_baseline',
        'label' => 'Protective Factors Present',
        'name' => 'protective_factors_baseline',
        'type' => 'checkbox',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Check all protective factors present at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            'family_support' => 'Strong family support',
            'positive_peers' => 'Positive peer relationships',
            'school_success' => 'Academic success/engagement',
            'community_involvement' => 'Community involvement',
            'faith_community' => 'Faith community connection',
            'talents_interests' => 'Special talents/interests',
            'positive_adult' => 'Positive adult mentor',
            'stable_housing' => 'Stable housing',
        ),
        'default_value' => array(),
        'layout' => 'vertical',
        'return_format' => 'value',
    ));
    
    // Field 31: Risk Factors Baseline
    acf_add_local_field(array(
        'key' => 'field_risk_factors_baseline',
        'label' => 'Risk Factors Present',
        'name' => 'risk_factors_baseline',
        'type' => 'checkbox',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Check all risk factors present at baseline',
        'required' => 0,
        'wrapper' => array('width' => '50'),
        'choices' => array(
            'substance_abuse' => 'Substance abuse',
            'mental_health' => 'Mental health concerns',
            'trauma_history' => 'Trauma history',
            'deviant_peers' => 'Deviant peer group',
            'gang_involvement' => 'Gang involvement',
            'family_conflict' => 'High family conflict',
            'poverty' => 'Poverty/economic stress',
            'unsafe_neighborhood' => 'Unsafe neighborhood',
            'poor_monitoring' => 'Poor parental monitoring',
            'school_failure' => 'School failure/disengagement',
        ),
        'default_value' => array(),
        'layout' => 'vertical',
        'return_format' => 'value',
    ));
    
    // Field 32: Safety Plan Baseline
    acf_add_local_field(array(
        'key' => 'field_safety_plan_baseline_text',
        'label' => 'Initial Safety Plan',
        'name' => 'safety_plan_baseline_text',
        'type' => 'textarea',
        'parent' => 'group_mst_case_master',
        'instructions' => 'Safety plan created at baseline (if needed)',
        'required' => 0,
        'wrapper' => array('width' => '100'),
        'rows' => 3,
        'placeholder' => 'Initial safety plan elements and protocols',
    ));
}

Comments

Add a Comment