package gov.va.med.esr.ui.admin.action;



import java.util.Date;
import java.util.List;

import gov.va.med.fw.ui.struts.AbstractForm;
import gov.va.med.fw.util.StringUtils;
/**
 * @author DNS   barryc
 */
public class HandBookBatchRequestForm extends AbstractForm {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6648875138328241937L;
	/**
	 * 
	 */
	
	// --------------------------------- Fields
	private String batchRequestId;
	private String releaseDate; 
	private String value;
	private String allVisnVamcSelected;
	private String dummySelect;
	private String priorityGroup = "8d";
	
	private String facilityDisplayBy;

    private String[] visn = {};
    private String[] visnFacility = {};
    private String[] facility = {};
    private String   stationNumbers;
    private String[] vamcs = {};
    private String[] visnVamcFacility = {};
    private String[] visnVamc = {};
    private String[] vamcFacility = {};

    private String vamc;
    
    private String  releaseCtl;
    private String  defaultReleaseCtl;
    private int  maxRecord;
    
    private String releaseNote;
    private boolean updateReleaseCtl;
	
	private List site;

	
	

	/**
	 * Whether to additionally run the retroactive process after updating the
	 * current year's value
	 */
	private boolean retroactiveProcess;

	public boolean isRetroactiveProcess() {
		return retroactiveProcess;
	}

	public void setRetroactiveProcess(boolean retroactiveProcess) {
		this.retroactiveProcess = retroactiveProcess;
	}

	

	

	public String getReleaseDate() {
		return releaseDate;
	}

	public void setReleaseDate(String releaseDate) {
		this.releaseDate = releaseDate;
	}

	public List getSite() {
		return site;
	}

	public void setSite(List site) {
		this.site = site;
	}

	public String getDummySelect() {
		return dummySelect;
	}

	public void setDummySelect(String dummySelect) {
		this.dummySelect = dummySelect;
	}
	 public String getStationNumbers() {
	        return this.stationNumbers;
	    }

	    public String[] getStationNumbersAsArray() {
	        if (StringUtils.isNotEmpty(this.stationNumbers)) {
	            String[] codes = this.stationNumbers.split(",");
	            //trim the spaces from the codes
	            int index = 0;
	            if ((codes != null) && (codes.length > 0)){
	                for (int i=0; i<codes.length; i++){
	                    String newCode = codes[i].trim();
	                    if (StringUtils.isNotEmpty(newCode)){
	                        codes[index++] = newCode;
	                    }
	                }
	                //create a new array and return
	                if (index > 0){
	                    String[] newArray = new String[index];
	                    for (int i=0; i<index; i++) {
	                        newArray[i] = codes[i];
	                    }
	                    return newArray;
	                } else {
						return new String[0];
					}
	            }
	        }
	        return new String[0];
	    }

	    public void setStationNumbers(String stattionNumbers) {
	        this.stationNumbers = stattionNumbers;
	    }
	    
	    
	    public void initialize() {
	       

	        this.facilityDisplayBy = null;
	        this.visn = new String[0];
	        this.visnFacility = new String[0];
	        this.facility = new String[0];
	        this.vamcs=new String[0];
	        this.vamcFacility=new String[0];
	        this.visnVamc=new String[0];
	        this.visnVamcFacility=new String[0];
	        this.vamc = null;
	        this.priorityGroup = null;
	    }

		public String[] getFacility() {
			return facility;
		}

		public void setFacility(String[] facility) {
			this.facility = facility;
		}

		public String getFacilityDisplayBy() {
			return facilityDisplayBy;
		}

		public void setFacilityDisplayBy(String facilityDisplayBy) {
			this.facilityDisplayBy = facilityDisplayBy;
		}

		public String getVamc() {
			return vamc;
		}

		public void setVamc(String vamc) {
			this.vamc = vamc;
		}

		public String[] getVamcFacility() {
			return vamcFacility;
		}

		public void setVamcFacility(String[] vamcFacility) {
			this.vamcFacility = vamcFacility;
		}

		public String[] getVamcs() {
			return vamcs;
		}

		public void setVamcs(String[] vamcs) {
			this.vamcs = vamcs;
		}

		public String[] getVisn() {
			return visn;
		}

		public void setVisn(String[] visn) {
			this.visn = visn;
		}

		public String[] getVisnFacility() {
			return visnFacility;
		}

		public void setVisnFacility(String[] visnFacility) {
			this.visnFacility = visnFacility;
		}

		public String[] getVisnVamc() {
			return visnVamc;
		}

		public void setVisnVamc(String[] visnVamc) {
			this.visnVamc = visnVamc;
		}

		public String[] getVisnVamcFacility() {
			return visnVamcFacility;
		}

		public void setVisnVamcFacility(String[] visnVamcFacility) {
			this.visnVamcFacility = visnVamcFacility;
		}

		public String getPriorityGroup() {
			return priorityGroup;
		}

		public void setPriorityGroup(String priorityGroup) {
			this.priorityGroup = priorityGroup;
		}

		public int getMaxRecord() {
			return maxRecord;
		}

		public void setMaxRecord(int maxRecord) {
			this.maxRecord = maxRecord;
		}

		public String getReleaseCtl() {
			return releaseCtl;
		}

		public void setReleaseCtl(String releaseCtl) {
			this.releaseCtl = releaseCtl;
		}

		public String getReleaseNote() {
			return releaseNote;
		}

		public void setReleaseNote(String releaseNote) {
			this.releaseNote = releaseNote;
		}

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public String getAllVisnVamcSelected() {
			return allVisnVamcSelected;
		}

		public void setAllVisnVamcSelected(String allVisnVamcSelected) {
			this.allVisnVamcSelected = allVisnVamcSelected;
		}

		public String getDefaultReleaseCtl() {
			return defaultReleaseCtl;
		}

		public void setDefaultReleaseCtl(String defaultReleaseCtl) {
			this.defaultReleaseCtl = defaultReleaseCtl;
		}

		public String getBatchRequestId() {
			return batchRequestId;
		}

		public void setBatchRequestId(String batchRequestId) {
			this.batchRequestId = batchRequestId;
		}

		public boolean isUpdateReleaseCtl() {
			return updateReleaseCtl;
		}

		public void setUpdateReleaseCtl(boolean updateReleaseCtl) {
			this.updateReleaseCtl = updateReleaseCtl;
		}
}
