// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String ACTIVE_CODE_NUMBER = "ACTIVE_CODE_NUMBER";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String AGE = "AGE";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_AGE = "sedation_age";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_SAME_MD = "sedation_same_md";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_STATUS = "sedation_status";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_TIME = "sedation_time";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String EPCODING = "EPCODING";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int MODIFIER_REQUEST_CODE = 1;
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String SAME_MD = "SAME_MD";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String SAVE_TEMP_ADDED_MODIFIERS = "SAVE_TEMP_ADDED_MODIFIERS";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int SEDATION_REQUEST_CODE = 2;
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String SEDATION_STATUS = "SEDATION_STATUS";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String TIME = "TIME";


import androidx.annotation.NonNull;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.preference.PreferenceManager;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import static org.epstudios.epcoding.Constants.ACTIVE_CODE_NUMBER;
import static org.epstudios.epcoding.Constants.AGE;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_AGE;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_SAME_MD;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_STATUS;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_TIME;
import static org.epstudios.epcoding.Constants.EPCODING;
import static org.epstudios.epcoding.Constants.MODIFIER_REQUEST_CODE;
import static org.epstudios.epcoding.Constants.SAME_MD;
import static org.epstudios.epcoding.Constants.SAVE_TEMP_ADDED_MODIFIERS;
import static org.epstudios.epcoding.Constants.SEDATION_REQUEST_CODE;
import static org.epstudios.epcoding.Constants.SEDATION_STATUS;
import static org.epstudios.epcoding.Constants.TIME;
        summarizeButton.setOnClickListener(this);
        Button clearButton = rootView.findViewById(R.id.clear_button);
        clearButton.setOnClickListener(this);

        return rootView;
    }

    private void redrawCheckBox(Code code) {
        CodeCheckBox checkBox = getCheckBoxWithCode(code.getCodeNumber());
        if (checkBox != null) {
            // forces checkbox to redraw itself
            // checkBox.invalidate() doesn't work for some reason
            checkBox.setCode(code);
        }
    }

    private void createCheckBoxLayoutAndCodeMap(Code[] codes,
                                                Map<String, CodeCheckBox> codeCheckBoxMap, LinearLayout layout) {
        for (Code code : codes) {
            final CodeCheckBox codeCheckBox = new CodeCheckBox(context);
            // codes[i].setPlusShown(plusShownInDisplay);
            codeCheckBox.setCodeFirst(mItem == allProcedures);
            codeCheckBox.setCode(code);
            codeCheckBoxMap.put(code.getCodeNumber(), codeCheckBox);
            // add long click listener to open modifier dialog
            // because they are disabled.  This is an Android limitation, though
            // any code can be long clicked and modified in the all codes module.
            codeCheckBox.setOnLongClickListener(view -> {
                Intent intent = new Intent(getActivity(), ModifierActivity.class);
                intent.putExtra(ACTIVE_CODE_NUMBER, codeCheckBox.getCodeNumber());
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String ACTIVE_CODE_NUMBER = "ACTIVE_CODE_NUMBER";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String AGE = "AGE";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_AGE = "sedation_age";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_SAME_MD = "sedation_same_md";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_STATUS = "sedation_status";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String BUNDLE_SEDATION_TIME = "sedation_time";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String EPCODING = "EPCODING";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int MODIFIER_REQUEST_CODE = 1;
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String SAME_MD = "SAME_MD";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public static final String SAVE_TEMP_ADDED_MODIFIERS = "SAVE_TEMP_ADDED_MODIFIERS";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static int SEDATION_REQUEST_CODE = 2;
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String SEDATION_STATUS = "SEDATION_STATUS";
// 
// Path: app/src/main/java/org/epstudios/epcoding/Constants.java
// public final static String TIME = "TIME";


// Path: app/src/main/java/org/epstudios/epcoding/ProcedureDetailFragment.java
import androidx.annotation.NonNull;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.preference.PreferenceManager;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import static org.epstudios.epcoding.Constants.ACTIVE_CODE_NUMBER;
import static org.epstudios.epcoding.Constants.AGE;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_AGE;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_SAME_MD;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_STATUS;
import static org.epstudios.epcoding.Constants.BUNDLE_SEDATION_TIME;
import static org.epstudios.epcoding.Constants.EPCODING;
import static org.epstudios.epcoding.Constants.MODIFIER_REQUEST_CODE;
import static org.epstudios.epcoding.Constants.SAME_MD;
import static org.epstudios.epcoding.Constants.SAVE_TEMP_ADDED_MODIFIERS;
import static org.epstudios.epcoding.Constants.SEDATION_REQUEST_CODE;
import static org.epstudios.epcoding.Constants.SEDATION_STATUS;
import static org.epstudios.epcoding.Constants.TIME;

        summarizeButton.setOnClickListener(this);
        Button clearButton = rootView.findViewById(R.id.clear_button);
        clearButton.setOnClickListener(this);

        return rootView;
    }

    private void redrawCheckBox(Code code) {
        CodeCheckBox checkBox = getCheckBoxWithCode(code.getCodeNumber());
        if (checkBox != null) {
            // forces checkbox to redraw itself
            // checkBox.invalidate() doesn't work for some reason
            checkBox.setCode(code);
        }
    }

    private void createCheckBoxLayoutAndCodeMap(Code[] codes,
                                                Map<String, CodeCheckBox> codeCheckBoxMap, LinearLayout layout) {
        for (Code code : codes) {
            final CodeCheckBox codeCheckBox = new CodeCheckBox(context);
            // codes[i].setPlusShown(plusShownInDisplay);
            codeCheckBox.setCodeFirst(mItem == allProcedures);
            codeCheckBox.setCode(code);
            codeCheckBoxMap.put(code.getCodeNumber(), codeCheckBox);
            // add long click listener to open modifier dialog
            // because they are disabled.  This is an Android limitation, though
            // any code can be long clicked and modified in the all codes module.
            codeCheckBox.setOnLongClickListener(view -> {
                Intent intent = new Intent(getActivity(), ModifierActivity.class);
                intent.putExtra(ACTIVE_CODE_NUMBER, codeCheckBox.getCodeNumber());
                intent.putExtra(SAVE_TEMP_ADDED_MODIFIERS, false);