/********************************************************************
 * Copyright © 2006 VHA. All rights reserved
 ********************************************************************/
package gov.va.med.esr.ui.common.beans;

// ESR Classes
import java.util.LinkedHashMap;
import java.util.Map;

import gov.va.med.esr.common.model.lookup.EnrollmentPriorityGroup;
import gov.va.med.esr.common.model.lookup.EnrollmentPrioritySubGroup;
import gov.va.med.fw.model.lookup.AbstractNamedLookup;

/**
 * VISN lists
 * @author Muddaiah Ranga
 * @version 3.0
 */
public class EnrollmentPriorityGroupAndSubGroup extends AbstractNamedLookup {

    private static final long serialVersionUID = 915500788991057052L;

    private static Map groupDescription = new LinkedHashMap();
    private static Map subGroupDescription = new LinkedHashMap();
    static {
        groupDescription.put(EnrollmentPriorityGroup.GROUP_1.getCode(),"Service-connected 50% to 100%");
        groupDescription.put(EnrollmentPriorityGroup.GROUP_2.getCode(),"Service-connected 30% or 40% disabling");
        groupDescription.put(EnrollmentPriorityGroup.GROUP_3.getCode(),"Service-connected 10% or 20% disabling, POW, Purple Heart");
        groupDescription.put(EnrollmentPriorityGroup.GROUP_4.getCode(),"Aid & Attendance, housebound, catastrophically disabled");
        groupDescription.put(EnrollmentPriorityGroup.GROUP_5.getCode(),"VA Pension, Eligible for Medicaid, or income below MT threshold");
        groupDescription.put(EnrollmentPriorityGroup.GROUP_6.getCode(),"VA compensation, radiation exposure, Agent Orange exposure, SHAD, Environmental Contaminants,Camp Lejeune");
        groupDescription.put(EnrollmentPriorityGroup.GROUP_7.getCode(),"Income greater than income threshold and below GMT threshold");
        groupDescription.put(EnrollmentPriorityGroup.GROUP_8.getCode(),"Income greater than income threshold and GMT threshold");
    }
    static {
        subGroupDescription.put(EnrollmentPrioritySubGroup.SUBGROUP_A.getCode(),"Noncompensable 0% service-connected, continuously enrolled on a specific date");
        subGroupDescription.put(EnrollmentPrioritySubGroup.SUBGROUP_A.getCode(),"0% service-connected, non-compensable Veteran who applies for enrollment after the effective date of the new provision (expected in June 2009), and whose income exceeds the applicable income thresholds by 10%");
        subGroupDescription.put(EnrollmentPrioritySubGroup.SUBGROUP_C.getCode(),"Non service-connected, continuously enrolled on a specific date");
        subGroupDescription.put(EnrollmentPrioritySubGroup.SUBGROUP_C.getCode(),"Non service-connected Veterans without special eligibility");
        subGroupDescription.put(EnrollmentPrioritySubGroup.SUBGROUP_E.getCode(),"Noncompensable 0% service-connected, applying for enrollment after 1/16/2003");
        subGroupDescription.put(EnrollmentPrioritySubGroup.SUBGROUP_G.getCode(),"Non service-connected, applying for enrollment after 1/16/2003");

    }

    private EnrollmentPriorityGroup group;
    private EnrollmentPrioritySubGroup subGroup;

    public EnrollmentPriorityGroupAndSubGroup(EnrollmentPriorityGroup group, EnrollmentPrioritySubGroup subGroup) {
        super();
        this.group = group;
        this.subGroup = subGroup;
    }

    public String getCode() {
        return (subGroup != null) ? group.getCode() + "," + subGroup.getCode() : group.getCode();
    }


    public String getDescription() {
        String desc = "";
        if(subGroup == null) {
            desc = group.getCode() + " - " + groupDescription.get(group.getCode());
        } else {
            desc = group.getCode() + subGroup.getDescription() + " - " + groupDescription.get(subGroup.getCode());
        }
        return desc;
    }
}
